import request from '@/utils/request'

// 文件上传
export function uploadFile(file) {
  const formData = new FormData()
  formData.append('file', file)
  console.log('[uploadFile] 请求参数:', file)
  return request({
    url: '/file/upload',
    method: 'post',
    data: formData,
    headers: { 'Content-Type': 'multipart/form-data' }
  }).then(res => {
    console.log('[uploadFile] 响应结果:', res)
    return res
  })
}
